<template>
    <div class="c-panel login">
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
          <el-form-item label="业务编号">
    <el-input v-model="formInline.serviceid"  :disabled="true" ></el-input>
  </el-form-item>
            <el-form-item label="业务编号">
    <el-input v-model="formInline.servicenumber"  :disabled="true" ></el-input>
  </el-form-item>
  <el-form-item label="申请人">
    <el-input v-model="formInline.proposername" :disabled="true"></el-input>
  </el-form-item>
  <el-form-item label="申请人身份证件号码">
    <el-input v-model="formInline.idcard" :disabled="true"></el-input>
  </el-form-item>
   <el-form-item label="代理人">
    <el-input v-model="formInline.agentname" :disabled="true"></el-input>
  </el-form-item>
   <el-form-item label="代理人身份证号">
    <el-input v-model="formInline.idcard1" :disabled="true"></el-input>
  </el-form-item>
   <el-form-item label="房屋编号">
    <el-input v-model="formInline.roomnumber" :disabled="true"></el-input>
  </el-form-item>
  <br>
  <el-form-item>
    <el-button type="primary" @click="onSubmit">受理</el-button>
  </el-form-item>
</el-form>
    </div>
</template>
<script>
export default{
    name:"addPreSale",
       props:['params'],
    data () {
        return {
          serviceid:this.params.serviceid,
             formInline: {
     serviceid:this.params.serviceid.serviceid,
     servicetype:"",
     servicenumber:"",
     proposer:"",
     idcard:"",
     agent:"",
     idcard1:"",
     photo:"",
     roomnumber:""
             }

             } 
    },mounted () {
        this.detail()
    }, 
    methods:{
detail(){
            var the = this;
            this.sa.ajax("/presale/findByServiceId",{
              'serviceid':the.serviceid.serviceid
            },
            function(data){
                the.formInline = data.data;

            })
        },
         onSubmit(){
           var the = this;
   
          this.sa.ajax("/presale/add",{
             'serviceid':the.serviceid.serviceid,
              'registrationtypeid':2,
              'obligee':the.serviceid.proposer,
              'boligeenumber':the.serviceid.idcard,
              'obligor':the.serviceid.agent,
              'obligornumber':the.serviceid.idcard1,
              'uid':1,
              'roomid':the.serviceid.photo},
          function(data){
            if(data.data!=0){
              var tab = {id: 'PresalePermitRegistration', name: '添加楼盘', view: () => import('@/sa-view/WmtbuildManager/PresalePermitRegistration.vue') };
            this.sa_admin.showTab(tab);
            }
          })
        }
}
}
</script>
<style scoped>
.login{
  width: 400px;
  height: 900px;
  /* 把元素变成定位元素 */
  position: absolute;
  /* 元素距离上，左都为50% */
  left: 50%;
  top: 25%;
  /* 让元素的左外边距，上外边距为元素宽高的1/2 注意margin是负距*/
  margin-top: -150px;
  margin-left: -200px;
  text-align: center
}
</style>
